package org.fatewa.engine.exception;

import org.fatewa.engine.advice.protocol.RayquazaResponse;
import org.fatewa.engine.design.advice.AbstractExceptionProcessor;
import org.springframework.http.HttpStatus;
import org.springframework.web.HttpRequestMethodNotSupportedException;

/**
 * 请求方法不支持的异常处理器
 *
 * @author fatewa
 */
public class HttpRequestMethodNotSupportedProcessor extends
        AbstractExceptionProcessor<HttpRequestMethodNotSupportedException> {
    @Override
    public RayquazaResponse map(HttpRequestMethodNotSupportedException e) {
        return new RayquazaResponse()
                .msg("请求方法不支持")
                .code(HttpStatus.FORBIDDEN);
    }
}
